import 'package:flutter/material.dart';

class Search extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return new _SearchState();
  }
}

class _SearchState extends State<Search> {
  TextEditingController _searchTextController = new TextEditingController();

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Scaffold(
      appBar: new AppBar(
        title: new TextField(
          autofocus: true,
          decoration: new InputDecoration(
              contentPadding: const EdgeInsets.all(7.0),
              filled: true,
              fillColor: Colors.white,
              hintText: '说你想说',
              border: new OutlineInputBorder()),
          controller: _searchTextController,
          onSubmitted: (value) {
            print(value);
          },
        ),
        actions: <Widget>[
          new IconButton(
            icon: new Icon(Icons.search),
            onPressed: () {
              Navigator.of(context).pop();
            },
          )
        ],
      ),
      body: new Center(
        child: new Column(
          children: <Widget>[
            new Container(
              child: new ExpansionTile(
                leading: new Icon(Icons.apps),
                title: new Text('热点关键词'),
                children: <Widget>[
                  new ListTile(
                    leading: new Text('1'),
                    title: new Text('猫为什么有尾巴?'),
                    trailing: new IconButton(icon: new Icon(Icons.clear,size: 15.0,), onPressed: () {}),
                    onTap: (){},
                  ),
                  new ListTile(
                    leading: new Text('2'),
                    title: new Text('老鼠与恐龙是什么关系?'),
                    trailing: new IconButton(icon: new Icon(Icons.clear,size: 15.0,), onPressed: () {}),
                    onTap: (){},
                  ),
                  new ListTile(
                    leading: new Text('3'),
                    title: new Text('后裔如果没有弓怎么办?'),
                    trailing: new IconButton(icon: new Icon(Icons.clear,size: 15.0,), onPressed: () {}),
                    onTap: (){},
                  ),
                ],
              ),
            ),
            new Expanded(
              child: new Center(
                child: new Text('1111'),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
